﻿#ifndef CUSTOM_COMMON_INCLUDE
#define CUSTOM_COMMON_INCLUDE

// #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
// 定义 PerceptualSmoothnessToPerceptualRoughness
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"

// 定义以下右侧变量
#include "UnityInput.hlsl"

// 以下定义为避免 SpaceTransforms.hlsl 返回的变量没有定义
float3 _WorldSpaceCameraPos;

#define UNITY_MATRIX_M unity_ObjectToWorld
#define UNITY_MATRIX_I_M unity_WorldToObject

#define UNITY_PREV_MATRIX_M unity_prev_MatrixM
#define UNITY_PREV_MATRIX_I_M unity_prev_MatrixIM
#define UNITY_MATRIX_V unity_MatrixV
#define UNITY_MATRIX_I_V unity_MatrixInvV
#define UNITY_MATRIX_VP unity_MatrixVP
#define UNITY_MATRIX_P glstate_matrix_projection

// 定义了 GPU Instancing 用到的宏 如：UNITY_INSTANCING_BUFFER_START
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"

// 定义了顶点函数中用到的空间变换的方法 如：TransformObjectToWorld、TransformObjectToWorldNormal
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"

float Square (float x) {
	return x * x;
}

#endif
